import numpy as np

np.random.seed(1)

confidence = np.random.randint(0, 100, [5, 5, 4]) / 100.
probs = confidence.copy()
print(confidence)
print(confidence.shape)

filter_probs = confidence >= 0.9
print(filter_probs)
print(filter_probs.shape)

filter_index = np.nonzero(filter_probs)
for el in filter_index:
    print(el.shape)
print(filter_index)

probs_filter = probs[filter_probs]
print(probs_filter)
print(probs_filter.shape)
